/*
 *  This file is part of LifeBudget - Copyright 2010 Clifton Eaton
 *  ------------------------------------------------------------------
 *  LifeBudget is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  LifeBudget is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with LifeBudget.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.lifebudget.app.client.service;

import java.util.List;

import org.lifebudget.app.client.mvc.model.CategoryTotal;
import org.lifebudget.app.client.mvc.model.PaycheckCalculator;
import org.lifebudget.app.client.mvc.model.Transaction;
import org.lifebudget.app.client.mvc.model.TransactionData;
import org.lifebudget.app.server.PaycheckCalculatorServiceImpl;
import org.lifebudget.app.server.TransactionServiceImpl;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * defines the RPC methods to be implemented  by the GWT proxy for 
 * {@link TransactionServiceAsync} and for the {@link TransactionServiceImpl}. 
 * Handles client-server communication for {@link PaycheckCalculator} operations.
 */
@RemoteServiceRelativePath("transaction")
public interface TransactionService extends RemoteService {
	
	/**
	 * Gets the transaction data.
	 *
	 * @return the transaction data
	 */
	public TransactionData getTransactionData();

	/**
	 * Save transactions.  Also adds new transactions.
	 *
	 * @param transactions the transactions
	 * @return the list of current transactions after the update.
	 */
	public List<Transaction> saveTransactions(List<Transaction> transactions);

	/**
	 * Removes the transaction.
	 *
	 * @param transaction the transaction
	 */
	public void removeTransaction(Transaction transaction);

	/**
	 * Gets the category totals.
	 *
	 * @return the category totals
	 */
	public List<CategoryTotal> getCategoryTotals();
}
